<template>
	<u-popup v-model="twoShow" mode="bottom" @close='close'>
		<view class="draw-one-pop">
			<view class="one-pop-title">
				<text>潮卡市场</text>
			</view>
			<view class="one-pop-first" v-for="(item,index) in list" :key="index" @click="setitem(index)">
				<view class="new-flex">
					<view class="one-pop-left">
						<image :src="$util.img(item.icon)" mode="widthFix"></image>
						<view class="pp-title">{{item.title}}</view>
					</view>
					<view class="one-pop-right">
						<text>剩余：{{item.surplus_num}}</text>
					</view>
				</view>
			</view>
		</view>
	</u-popup>
</template>

<script>
	export default {
		props: {
			show: {
				type: [String, Boolean],
				default: false
			}
		},
		watch: {
			show: {
				handler(newval, oldVal) {
					this.twoShow = this.show;
				},
				immediate: true
			}
		},
		data() {
			return {
				twoShow: false,
				num: 0,
				list:[]
			}
		},
		mounted() {},
		methods:{
			close(){
				this.$emit('close')
			},
			setinfo(list){
				this.list = list;
				this.twoShow = true;
			},
			setitem(index){
				this.$emit('setitem',index)
				this.twoShow = false;
			}
		}
	}
</script>

<style lang="scss" scoped>
	.draw-one-pop{
		width: 100%;
		height: 60vh;
		background: #F7F8FA;
		border-radius: 20rpx 20rpx 0px 0px;
		padding: 30rpx;
		.one-pop-title{
			margin-bottom:30rpx;
			text{
				font-size: 38rpx;
				font-family: PingFang SC;
				font-weight: 800;
				color: #000000;
			}
		}
		.one-pop-first{
			margin-bottom:30rpx;
			padding: 20rpx 20rpx;
			border: 1px solid #000000;
			border-radius: 10rpx;
			.new-title{
				text{
					font-size: 26rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #000000;
				}
			}
			.new-flex{
				display: flex;
				align-items: center;
				justify-content: space-between;
				.one-pop-left{
					display: flex;
					align-items: center;
					image{
						width: 80rpx;
						height: 80rpx;
					}
					.pp-title{
						width: 200rpx;
						font-size: 30rpx;
						font-family: PingFang SC;
						font-weight: bold;
						color: #000000;
						white-space: nowrap;
						overflow: hidden;
						text-overflow: ellipsis;
						margin-left: 30rpx;
					}
				}
				.one-pop-right{
					display: flex;
					align-items: center;
					text{
						margin-right: 30rpx;
						font-size: 26rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #000000;
					}
				}
			}
		}
	}
</style>